<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>拓展学习-数组every用法</title>
    </head>
    <body>
        
    </body>
    <script>
        const arr = [
            {id:1,name:'西瓜',state:true},
            {id:2,name:'哈密瓜',state:true},
            {id:3,name:'桃子',state:true},
            {id:4,name:'苹果',state:false},
        ]
    //    判断数组中是否被全选了
        const isAll = arr.every(item=>item.state);
        console.log('isAll',isAll);
    </script>
</html>